<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

</head>

<body>
    <input type="text" name="" id="input1">

    <script>
        const input1 = document.getElementById('input1')

        input1.onkeydown = function () {
            console.log('onkeydown');
        }

        input1.onkeyup = function () {
            console.log('onkeyup');
        }


    </script>

</body>

</html>